package com.funong.matrix.biz.power.facade.impl;

import com.funong.matrix.biz.base.entity.SysPermissionEntity;
import com.funong.matrix.biz.power.domain.SysRolePermissionDomainDao;
import com.funong.matrix.biz.power.facade.SysRolePermissionFacade;
import com.funong.matrix.biz.power.pojo.dto.SysRolePermissionDTO;
import com.funong.matrix.core.dto.QueryDTO;
import com.funong.matrix.core.dto.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysRolePermissionFacadeImpl implements SysRolePermissionFacade {
    @Autowired
    private SysRolePermissionDomainDao sysRolePermissionDomainDao;


    @Override
    public SysRolePermissionDTO queryPermissionListByRoleCode(String roleCode) {
        return sysRolePermissionDomainDao.queryPermissionListByRoleCode(roleCode);
    }

    @Override
    public void saveRolePermission(SysRolePermissionDTO rolePermissionDTO) {
        sysRolePermissionDomainDao.saveRolePermission(rolePermissionDTO);

    }

    @Override
    public void saveRoleUser(SysRolePermissionDTO rolePermissionDTO) {
        sysRolePermissionDomainDao.saveRoleUser(rolePermissionDTO);
    }

    @Override
    public List<String> queryPermissionCodeByRoleCode(String roleCode) {
        return sysRolePermissionDomainDao.queryPermissionCodeByRoleCode(roleCode);
    }



    @Override
    public Result<List<SysPermissionEntity>> queryPermissionList(QueryDTO<SysPermissionEntity> permissionQO) {
        return sysRolePermissionDomainDao.queryPermissionList(permissionQO);
    }

    @Override
    public Boolean savePermission(SysPermissionEntity sysPermissionEntity) {
        return sysRolePermissionDomainDao.savePermission(sysPermissionEntity);
    }

    @Override
    public Boolean deletePermission(SysPermissionEntity sysPermissionEntity) {
        return sysRolePermissionDomainDao.deletePermission(sysPermissionEntity);
    }

    @Override
    public Boolean updatePermission(SysPermissionEntity sysPermissionEntity) {
        return sysRolePermissionDomainDao.updatePermission(sysPermissionEntity);
    }

    @Override
    public List<SysPermissionEntity>  queryPermissionList() {
        return sysRolePermissionDomainDao.queryPermissionList();
    }
}
